{% extends 'adminlte/lib/base.html' %}

{% block content %}
    <div class="box">
        <!-- form start -->
        <form role="form" method="post">{% csrf_token %}
            <div class="box-body">
                <div class="form-group">
                    <label for="id">ID</label>
                    <input id="id" class="form-control" value="{{ user.id }}" disabled />
                </div>
                <div class="form-group">
                    <label for="name">name</label>
                    <input id="name" class="form-control" value="{{ user.username }}" disabled />
                </div>
                {% if groups %}
                <div class="form-group">
                    <label>Permissions</label>
                    {% for group in groups %}
                        <div class="checkbox">
                            <label>
                            <input type="checkbox"
                                   name="groups"
                                   {% if group in user_groups %}checked{% endif %}
                                   value="{{ group.id }}">
                            {{ group.name }}
                            </label>
                        </div>
                    {% endfor %}
                </div>
                {% endif %}
            </div>
            <!-- /.box-body -->

            <div class="box-footer">
                <button type="submit" class="btn btn-primary">提交</button>
            </div>
        </form>
    </div>
    <!-- /.box -->
{% endblock %}
